package com.mpp.admin.entity;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;


/**
 * @author mapp
 * @des layui 分页
 * @date 2019/2/14
 */
@Data
public class PageEntity extends Page {

    private String code;
    private String msg;

    public static PageEntity build(Integer page, Integer limit) {
        page = page == null ? 1 : page;
        limit = limit == null ? 10 : limit;
        return new PageEntity(page, limit);
    }

    public PageEntity(long current, long size) {
        super(current, size);
        this.code = "0";
        this.msg = "";
    }

    public PageEntity(long current, long size, String code, String msg) {
        super(current, size);
        this.code = code;
        this.msg = msg;
    }
}
